load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "upgradecluster",
    srcs = [
        "cluster.go",
        "nodes.go",
        "tenant_cluster.go",
    ],
    importpath = "github.com/cockroachdb/cockroach/pkg/upgrade/upgradecluster",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/keys",
        "//pkg/kv",
        "//pkg/kv/kvserver/liveness/livenesspb",
        "//pkg/roachpb",
        "//pkg/rpc",
        "//pkg/server/serverpb",
        "//pkg/sql/sqlinstance",
        "//pkg/sql/sqlinstance/instancestorage",
        "//pkg/util/ctxgroup",
        "//pkg/util/log",
        "//pkg/util/netutil",
        "//pkg/util/quotapool",
        "//pkg/util/rangedesc",
        "//pkg/util/retry",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_cockroachdb_redact//:redact",
        "@org_golang_google_grpc//:go_default_library",
    ],
)

go_test(
    name = "upgradecluster_test",
    size = "small",
    srcs = [
        "helper_test.go",
        "main_test.go",
        "nodes_test.go",
    ],
    embed = [":upgradecluster"],
    deps = [
        "//pkg/kv/kvserver/liveness/livenesspb",
        "//pkg/roachpb",
        "//pkg/rpc",
        "//pkg/security/securityassets",
        "//pkg/security/securitytest",
        "//pkg/server",
        "//pkg/server/serverpb",
        "//pkg/testutils",
        "//pkg/testutils/serverutils",
        "//pkg/testutils/testcluster",
        "//pkg/util/leaktest",
        "//pkg/util/retry",
        "//pkg/util/syncutil",
        "@org_golang_google_grpc//:go_default_library",
    ],
)
